package com.ruoyi.apis.controller;

import com.ruoyi.apis.entity.CityEntity;
import com.ruoyi.apis.service.ICityService;
import com.ruoyi.apis.vo.CityVO;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author Choi
 * @Date 2021/8/23
 */

@Api(value = "城市", tags = "城市相关接口")
@RestController
@RequestMapping("/api")
public class ICityController {

    @Autowired
    private ICityService cityService;

    /**
     * 城市列表
     */
    @ApiOperation(value = "城市列表")
    @GetMapping("/cities")
    public AjaxResult city() {
        List<CityVO> cities = cityService.getCities();
        return AjaxResult.success(cities);
    }
}
